//
//  RHUserModel.m
//  RuiHeAppApp
//
//  Created by Yan Chen on 2023/8/2.
//

#import "RHUserModel.h"

@implementation RHUserModel
//自定义转化
- (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {
    if([dic[@"roles"]isKindOfClass:[NSArray class]]){
        if([dic[@"roles"] count]>0&&[dic[@"roles"][0] isKindOfClass:[NSDictionary class]] ){
//            _role = dic[@"roles"][0][@"roleName"];
            _role = [RHRoleModel yy_modelWithJSON:dic[@"roles"][0]];
        }
    }
    return YES;
}




//解档
- (void)encodeWithCoder:(NSCoder *)coder
{
    [self yy_modelEncodeWithCoder:coder];
}

//归档
- (nullable instancetype)initWithCoder:(NSCoder *)coder
{
    self = [super init];
    return  [self yy_modelInitWithCoder:coder];
}

@end
